<template>
	<view style="margin-top: 6vw;position: relative;" class="uni-steps">
		<view class="x2" style="
		color: white;
		text-align: center;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 2.93vw;
		position: absolute;
		right: 3vw;
		top: -6vw;
		width: 8.266vw;height: 4.8vw; background-image: url('../../static/images/user/x2.png'); "  >
		<text style="margin-bottom: 1vw;">x2</text>
		</view>
		<!-- <image style="width: 8.266vw;height: 4.8vw;" src="../../static/images/user/x2.png" mode=""></image> -->
		<view  style="display: flex;justify-content: space-around;">
			<view v-for="(item,index) in options " :key="index" :style="{backgroundColor:index + 1 <=active?bgColor:'#F3F3F3'}" style="
			display: flex;flex-direction: column;justify-content: center;
			width: 10.4vw;height: 12.8vw;" >

				<!-- 积分计算 -->
				<view style="margin: 1vw 0;" 
					:class="[direction==='column'?'uni-steps__column-text-container':'uni-steps__row-text-container']">
					<view style="margin: 0;" :class="[direction==='column'?'uni-steps__column-text':'uni-steps__row-text']">
						<text :style="{color:index + 1 <=active?activeColor:deactiveColor}"
							:class="[direction==='column'?'uni-steps__column-desc':'uni-steps__row-desc']">
							{{item.desc}}</text>
					</view>
				</view>


				<!-- 步骤条 -->
				<view :class="[direction==='column'?'uni-steps__column-container':'uni-steps__row-container']">
					
					<view :class="[direction==='column'?'uni-steps__column-line-item':'uni-steps__row-line-item']">
						<!-- <view :class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--before':'uni-steps__row-line--before']"
					 :style="{backgroundColor:index<=active&&index!==0?activeColor:index===0?'transparent':deactiveColor}"></view> -->
						<!-- <template v-if="item.circle"> -->
						<!-- 第7+天 -->
						<!-- 	<view>
							<image :src='item.circle' :style='item.circleStyle'></image>
						</view> -->
						<!-- </template> -->
						<!-- 步骤条样式和切换 -->
						<!-- <image style="width: 8.266vw;height: 4.8vw;" src="../../static/images/user/x2.png" mode=""></image> -->
						<template>
							
							
							<view :class="[direction==='column'?'uni-steps__column-check':'uni-steps__row-check']"
								v-if="index + 1 <= active">
								<text :style="{color:activeColor}" class="wlIcon-pintuantuangouchenggong"></text>
							</view>
							<view v-else :style="{backgroundColor:index<active?activeColor:'#F3F3F3'}" style="font-size: 2.93vw;color: #999999;" >
							<text v-show="active == 0">{{dateMounst}}.{{Number(dateDay) +(index-active) }} </text>
							<text v-show = "active !== 0">{{dateMounst}}.{{Number(dateDay) +(index+1-active) }} </text>
							</view>
						</template>
						<!-- <view :class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--after':'uni-steps__row-line--after']"
					 :style="{backgroundColor:index<active&&index!==options.length-1?activeColor:index===options.length-1?'transparent':deactiveColor}"></view> -->
					</view>
				</view>



			</view>
			<!-- 周几 -->
		</view>
		<view  :class="[direction==='column'?'uni-steps__column-text-container':'uni-steps__row-text-container']">
			<view v-for="(item,index) in newWeek" :key="index"
				:class="[direction==='column'?'uni-steps__column-text':'uni-steps__row-text']">
				<text style="color: #9C9C9C;font-size: 2.93vw;"
					:class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{item}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'WanlSteps',
		props: {
			direction: {
				// 排列方向 row column
				type: String,
				default: 'row'
			},
			activeColor: {
				// 激活状态颜色
				type: String,
				default: '#11E195'
			},
			deactiveColor: {
				// 未激活状态颜色
				type: String,
				default: '#cccccc'
			},
			active: {
				// 当前步骤
				type: Number,
				default: 0
			},
			newWeek:{
				type: Array,
				default () {
					return [{

					}]
				}
			}, 
			options: {
				type: Array,
				default () {
					return [{

					}]
				}
			}, // 数据
			last: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
			bgColor:"#DDF8E7",
			dateMounst:new Date().toISOString().slice(6, 7),
			dateDay:new Date().toISOString().slice(8, 10)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.uni-steps {
		/* #ifndef APP-NVUE */
		display: flex;
		width: 100%;
		/* #endif */
		/* #ifdef APP-NVUE */
		flex: 1;
		/* #endif */
		flex-direction: column;
	}

	.uni-steps__row {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
	}

	.uni-steps__column {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row-reverse;
	}

	.uni-steps__row-text-container {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		margin: 30rpx 0;
	}

	.uni-steps__column-text-container {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		flex: 1;
	}

	.uni-steps__row-text {
		/* #ifndef APP-NVUE */
		display: inline-flex;
		/* #endif */
		flex: 1;
		flex-direction: column;
	}

	.uni-steps__column-text {
		padding: 6px 0px;
		border-bottom-style: solid;
		border-bottom-width: 1px;
		border-bottom-color: #e2e2e2;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
	}

	.uni-steps__row-title {
		font-size: 28rpx;
		line-height: 16px;
		text-align: center;
	}

	.uni-steps__column-title {
		font-size: 28rpx;
		text-align: left;
		line-height: 18px;
	}

	.uni-steps__row-desc {
		font-size: 12px;
		line-height: 14px;
		text-align: center;
	}

	.uni-steps__column-desc {
		font-size: 24rpx;
		text-align: left;
		line-height: 18px;
	}

	.uni-steps__row-container {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
	}

	.uni-steps__column-container {
		/* #ifndef APP-NVUE */
		display: inline-flex;
		/* #endif */
		width: 30px;
		flex-direction: column;
	}

	.uni-steps__row-line-item {
		/* #ifndef APP-NVUE */
		display: inline-flex;
		/* #endif */
		flex-direction: row;
		flex: 1;
		height: 14px;
		line-height: 14px;
		align-items: center;
		justify-content: center;
	}

	.uni-steps__column-line-item {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		flex: 1;
		align-items: center;
		justify-content: center;
	}

	.uni-steps__row-line {
		flex: 1;
		height: 1px;
		background-color: #919293;
	}

	.uni-steps__column-line {
		width: 1px;
		background-color: #919293;
	}

	.uni-steps__row-line--after {
		transform: translateX(1px);
	}

	.uni-steps__column-line--after {
		flex: 1;
		transform: translate(0px, 1px);
	}

	.uni-steps__row-line--before {
		transform: translateX(-1px);
	}

	.uni-steps__column-line--before {
		height: 6px;
		transform: translate(0px, -1px);
	}

	.uni-steps__row-circle {
		width: 10rpx;
		height: 10rpx;
		border-radius: 50rem;
		background-color: #919293;
		margin: 0px 20rpx;
	}

	.uni-steps__column-circle {
		width: 5px;
		height: 5px;
		border-radius: 100px;
		background-color: #919293;
		margin: 4px 0px 5px 0px;
	}

	.uni-steps__row-check {
		margin: 0px 6px;
	}

	.uni-steps__column-check {
		height: 14px;
		line-height: 14px;
		margin: 2px 0px;
	}
</style>